
<style>
    .searchhl{
        color: darkgoldenrod;
        font-weight: bold;
    }
</style>

<div>
    <div class="w-600 margin-auto tal-center">
        <br />
        <form method="GET" action="search">
            <input class="f18" name="query" value="<?= $this->query ?>"/>
            <input class="f18" type="submit" value="Найти в публикациях"/>
        </form>

        <form method="GET" action="search">
            <input class="f18" name="queryApho" value="<?= $this->queryApho ?>"/>
            <input class="f18" type="submit" value="Найти в афоризмах"/>
        </form>
    </div>      

    <? if ($this->query): ?>
        <h2>Поиск "<?= $this->query ?>"</h2>
    <? endif; ?>
        
    <? if ($this->queryApho): ?>
        <h2>Поиск "<?= $this->queryApho ?>"</h2>
    <? endif; ?>

    <div class="f12">

        <? if ($this->searchResultMessages): ?>
            <h2>Всего результатов: <?= count($this->searchResultMessages) ?></h2>
            <? $counter = 0; ?>
            <? foreach ($this->searchResultMessages as $oneMessage): ?>
                <? $counter++ ?>

              <? if($counter % 10 == 0 || $counter == 1):?>
                    <div class="tal-right">
                        Страница <?=floor($counter/10)+1?>
                    </div>
                    <hr />

                <? endif;?>
                <div>
                    <span class="c-gray">[<?= $counter ?>]</span>
                    <span class="f14"><a href="./message/<?= $oneMessage->getParentId()?>"><?= $oneMessage->getTitle() ?></a></span>
                    <div>
                        <span class="c-gray">Description:</span> <span><?= $this->boldWords($this->query, $oneMessage->getSeoOptions(), 'b', 'searchhl') ?></span><br />
                        <span class="c-gray">KeyWords:</span> <span><?= $this->boldWords($this->query, $oneMessage->getKeyWords(), 'b', 'searchhl') ?></span>
                         
                    </div>

                </div>
                <br />
            <? endforeach; ?>
        <? else: ?>
            <? if($this->query):?>
                <h2> В публикациях ничего не найдено</h2>
           <? endif;?>
        <? endif; ?>

    </div>


    <div class="f12">

        <? if ($this->searchResultAphorisms): ?>
            <h2>Всего результатов: <?= count($this->searchResultAphorisms) ?></h2>
            <? $counter = 0; ?>

            <? foreach ($this->searchResultAphorisms as $oneMessage): ?>
                <? $counter++ ?>

                <? if($counter % 10 == 0 || $counter == 1):?>
                    <div class="tal-right">
                        Страница <?=floor($counter/10)+1?>
                    </div>
                    <hr />
                    
                <? endif;?>
                <div>
                    <span class="c-gray">[<?= $counter ?>]</span>
                    <span class="f14"><a href="./search?queryApho=<?=$oneMessage->getTheme()?>"><?=$this->boldWords($this->queryApho, $oneMessage->getTheme(), 'b', 'searchhl')?></a></span>
                    <div>
                        <span><?= $this->boldWords($this->queryApho, $oneMessage->getText(), 'b', 'searchhl') ?></span><br />
                    </div>
                </div>
                <br />
                
            <? endforeach; ?>


          <? else: ?>
           <? if($this->queryApho):?>
                <h2> В афоризмах ничего не найдено</h2>
           <? endif;?>
        <? endif; ?>

    </div>


</div>

